package com.test.day04.inputStream;

import java.io.FileInputStream;
import java.io.IOException;

/**
 * @program: 把硬盘中的文件读取到内存中使用
 * @author: luhd
 * @create: 2021-08-05
 */
public class Demo01InputStream {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("a.txt");
        //int len = fis.read();
        //System.out.println(len);
        // len = fis.read();
        //System.out.println(len);
        // len = fis.read();
        //System.out.println(len);
        int len = 0; //记录读取到的字节
        while((len = fis.read()) != -1){
            System.out.println(len);
        }
        fis.close();
    }
}
